package com.ae.shield.common.recipe;

import com.ae.shield.ModLib;
import com.ae.shield.common.recipe.assembly.*;
import net.minecraft.item.crafting.IRecipeSerializer;
import net.minecraft.item.crafting.IRecipeType;
import net.minecraft.util.registry.Registry;
import net.minecraftforge.fml.RegistryObject;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;

public class ModRecipesType {
    public static final DeferredRegister<IRecipeSerializer<?>> RECIPE_SERIALIZER = DeferredRegister.create(ForgeRegistries.RECIPE_SERIALIZERS, ModLib.MOD_ID);

    public static final RegistryObject<AssemblyRecipe.Serializer> ASSEMBLY_SERIALIZER = RECIPE_SERIALIZER.register("assembly", AssemblyRecipe.Serializer::new);
    public static final IRecipeType<AssemblyRecipe> ASSEMBLY_TYPE = new AssemblyRecipe.AssemblyRecipeType();

    public static final RegistryObject<SuffixAssemblyRecipe.Serializer> SUFFIX_ASSEMBLY_SERIALIZER = RECIPE_SERIALIZER.register("suffix_assembly", SuffixAssemblyRecipe.Serializer::new);
    public static final IRecipeType<SuffixAssemblyRecipe> SUFFIX_ASSEMBLY_TYPE = new SuffixAssemblyRecipe.SuffixAssemblyRecipeType();

    public static final RegistryObject<EffectAssemblyRecipe.Serializer> EFFECT_ASSEMBLY_SERIALIZER = RECIPE_SERIALIZER.register("effect_assembly", EffectAssemblyRecipe.Serializer::new);
    public static final IRecipeType<EffectAssemblyRecipe> EFFECT_ASSEMBLY_TYPE = new EffectAssemblyRecipe.EffectAssemblyRecipeType();

    public static final RegistryObject<SuffixUpgradeAssemblyRecipe.Serializer> SUFFIX_UPGRADE_ASSEMBLY_SERIALIZER = RECIPE_SERIALIZER.register("suffix_upgrade_assembly", SuffixUpgradeAssemblyRecipe.Serializer::new);
    public static final IRecipeType<SuffixUpgradeAssemblyRecipe> SUFFIX_UPGRADE_ASSEMBLY_TYPE = new SuffixUpgradeAssemblyRecipe.SuffixUpgradeAssemblyRecipeType();

    public static final RegistryObject<ShieldUpgradeAssemblyRecipe.Serializer> SHIELD_UPGRADE_ASSEMBLY_SERIALIZER = RECIPE_SERIALIZER.register("shield_upgrade_assembly", ShieldUpgradeAssemblyRecipe.Serializer::new);
    public static final IRecipeType<ShieldUpgradeAssemblyRecipe> SHIELD_UPGRADE_ASSEMBLY_TYPE = new ShieldUpgradeAssemblyRecipe.ShieldUpgradeAssemblyRecipeType();

    public static void registerType() {
        Registry.register(Registry.RECIPE_TYPE, AssemblyRecipe.TYPE_ID, ASSEMBLY_TYPE);
        Registry.register(Registry.RECIPE_TYPE, SuffixAssemblyRecipe.getTypeId(), SUFFIX_ASSEMBLY_TYPE);
        Registry.register(Registry.RECIPE_TYPE, EffectAssemblyRecipe.getTypeId(), EFFECT_ASSEMBLY_TYPE);
        Registry.register(Registry.RECIPE_TYPE, SuffixUpgradeAssemblyRecipe.getTypeId(), SUFFIX_UPGRADE_ASSEMBLY_TYPE);
        Registry.register(Registry.RECIPE_TYPE, ShieldUpgradeAssemblyRecipe.getTypeId(), SHIELD_UPGRADE_ASSEMBLY_TYPE);
    }

}
